﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt;

    public class wf_node_atts_Map : ClassMapping<wf_node_atts>
    {
        public wf_node_atts_Map()
        {
            //映射ID
            Id(x => x.id, map => map.Length(40));

            Property(x => x.is_valid);
            Property(x => x.create_date);

            Property(x => x.file_name, map => map.Length(500));

            //记录所关联的附件
            ManyToOne(x => x.this_attachment, map =>
            {
                map.Column(t_attachment.Columns.att_id);
                map.NotNullable(false);
            });
            
            //记录所关联的审批节点
            ManyToOne(x => x.this_node, map =>
            {
                map.Column(wf_node.Columns.n_id);
                map.NotNullable(false);
            });

            Table(wf_node_atts.TableName);

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
